package com.zhou.essearch.document;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.Mapping;

import java.io.Serializable;
import java.util.Date;

/**
 * 产品实体
 * @author hgy
 * @version 0.1
 * @date 2018/12/13 15:22
 */
@Document(indexName = "people", type = "people")
@Mapping(mappingPath = "peopleIndex.json") // 解决IK分词不能使用问题
public class PeopleDocument implements Serializable {

    @Id
    private String id;
    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;
    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String desc;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
